package com.my.pojo;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.util.Date;

/**
* @Author: jiChen
* @Description: 库存实体类
* @Date: 2021/11/29 8:23 上午
*/

@Entity
@Getter
@Setter
@ToString
@RequiredArgsConstructor
@Table(name = "stock")
public class Stock {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "stock_id")
    private Integer stockId;

    @Column(name = "type")
    private Integer type;

    @Column(name = "date")
    private Date date;

    @Column(name = "num")
    private Integer num;

    @Column(name = "info")
    private String info;

    @Column(name = "status")
    private Integer status;


    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "goods_id")
    private Goods goods;

    @ManyToOne
    @JoinColumn(name = "orders_id")
    private Orders orders;

}
